<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AIfES 2: aifes_express_f32_fnn.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script>
<script type="text/javascript" async="async" src="https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="AIfES_logo_small.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AIfES 2
   &#160;<span id="projectnumber">2.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('aifes__express__f32__fnn_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">aifes_express_f32_fnn.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>AIfES Express functions for weights with F32 (float32) data type.  
<a href="#details">More...</a></p>

<p><a href="aifes__express__f32__fnn_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html">AIFES_E_model_parameter_fnn_f32</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parameters for the FNN model.  <a href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html">AIFES_E_training_parameter_fnn_f32</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parameters for Training.  <a href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_a_i_f_e_s___e__init__weights__parameter__fnn__f32.html">AIFES_E_init_weights_parameter_fnn_f32</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parameters for weight initialization.  <a href="struct_a_i_f_e_s___e__init__weights__parameter__fnn__f32.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:af79dec2c6e48d0a4bc1ab3443bbe0359"><td class="memItemLeft" align="right" valign="top"><a id="af79dec2c6e48d0a4bc1ab3443bbe0359"></a>
typedef struct <a class="el" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html">AIFES_E_model_parameter_fnn_f32</a>&#160;</td><td class="memItemRight" valign="bottom"><b>AIFES_E_model_parameter_fnn_f32</b></td></tr>
<tr class="separator:af79dec2c6e48d0a4bc1ab3443bbe0359"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a86c1eaca27d8e58e1a304ed0507db9b4"><td class="memItemLeft" align="right" valign="top"><a id="a86c1eaca27d8e58e1a304ed0507db9b4"></a>
typedef struct <a class="el" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html">AIFES_E_training_parameter_fnn_f32</a>&#160;</td><td class="memItemRight" valign="bottom"><b>AIFES_E_training_parameter_fnn_f32</b></td></tr>
<tr class="separator:a86c1eaca27d8e58e1a304ed0507db9b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac8b136eec59d63fd3bb313acf15754a0"><td class="memItemLeft" align="right" valign="top"><a id="ac8b136eec59d63fd3bb313acf15754a0"></a>
typedef struct <a class="el" href="struct_a_i_f_e_s___e__init__weights__parameter__fnn__f32.html">AIFES_E_init_weights_parameter_fnn_f32</a>&#160;</td><td class="memItemRight" valign="bottom"><b>AIFES_E_init_weights_parameter_fnn_f32</b></td></tr>
<tr class="separator:ac8b136eec59d63fd3bb313acf15754a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:a6dad88532ecc9bc7786bb69c0aab7c23"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23">AIFES_E_activations</a> { <br />
&#160;&#160;<a class="el" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23a90e8205e5c84ffb25fa38491b248b013">AIfES_E_relu</a>
, <a class="el" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23a68c5b8166b0ec1f39f3f66eae44907d6">AIfES_E_sigmoid</a>
, <a class="el" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23a28fa45b9eb596a129f1be02bcebf9cf7">AIfES_E_softmax</a>
, <a class="el" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23a34502c83d13d257df268941d828f33f8">AIfES_E_leaky_relu</a>
, <br />
&#160;&#160;<a class="el" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23ac682fe5e199bb2451b7bef2be8a55c4c">AIfES_E_elu</a>
, <a class="el" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23a7ca4f10620b8fca8ebf6e5d9a3ca4c98">AIfES_E_tanh</a>
, <a class="el" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23ae2e92c9f3fdd4f778fffa154346c2213">AIfES_E_softsign</a>
, <a class="el" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23af918200828e6049e46f83c0ca21db5b9">AIfES_E_linear</a>
<br />
 }</td></tr>
<tr class="memdesc:a6dad88532ecc9bc7786bb69c0aab7c23"><td class="mdescLeft">&#160;</td><td class="mdescRight">Possible activation functions in AIfES-Express.  <a href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23">More...</a><br /></td></tr>
<tr class="separator:a6dad88532ecc9bc7786bb69c0aab7c23"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d5599ca9f2382ad1150d53f6ba8cbea"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aifes__express__f32__fnn_8h.html#a9d5599ca9f2382ad1150d53f6ba8cbea">AIFES_E_loss</a> { <a class="el" href="aifes__express__f32__fnn_8h.html#a9d5599ca9f2382ad1150d53f6ba8cbeaaf095a896485970ce1b22f3e43fafb45a">AIfES_E_mse</a>
, <a class="el" href="aifes__express__f32__fnn_8h.html#a9d5599ca9f2382ad1150d53f6ba8cbeaac01d593ae21e3f8bbe8c0587b016dcdf">AIfES_E_crossentropy</a>
 }</td></tr>
<tr class="memdesc:a9d5599ca9f2382ad1150d53f6ba8cbea"><td class="mdescLeft">&#160;</td><td class="mdescRight">Possible loss functions in AIfES-Express.  <a href="aifes__express__f32__fnn_8h.html#a9d5599ca9f2382ad1150d53f6ba8cbea">More...</a><br /></td></tr>
<tr class="separator:a9d5599ca9f2382ad1150d53f6ba8cbea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac3fa2f42fb47ee5af7c7a3282d4f4cd0"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aifes__express__f32__fnn_8h.html#ac3fa2f42fb47ee5af7c7a3282d4f4cd0">AIFES_E_optimizer</a> { <a class="el" href="aifes__express__f32__fnn_8h.html#ac3fa2f42fb47ee5af7c7a3282d4f4cd0a4e1b034bc7b9050d2bf588d33cc31335">AIfES_E_adam</a>
, <a class="el" href="aifes__express__f32__fnn_8h.html#ac3fa2f42fb47ee5af7c7a3282d4f4cd0a96fcd4b510ad51973f2fb6e380f98ad4">AIfES_E_sgd</a>
 }</td></tr>
<tr class="memdesc:ac3fa2f42fb47ee5af7c7a3282d4f4cd0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Possible optimizers in AIfES-Express.  <a href="aifes__express__f32__fnn_8h.html#ac3fa2f42fb47ee5af7c7a3282d4f4cd0">More...</a><br /></td></tr>
<tr class="separator:ac3fa2f42fb47ee5af7c7a3282d4f4cd0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a35acc0093cf3f0ad28eb5c49b23d5e44"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aifes__express__f32__fnn_8h.html#a35acc0093cf3f0ad28eb5c49b23d5e44">AIFES_E_init_weights_method</a> { <a class="el" href="aifes__express__f32__fnn_8h.html#a35acc0093cf3f0ad28eb5c49b23d5e44aec06014a563924febf792beba6066e46">AIfES_E_init_uniform</a>
, <a class="el" href="aifes__express__f32__fnn_8h.html#a35acc0093cf3f0ad28eb5c49b23d5e44af87a4fcba3d2e974db34883d63e763e6">AIfES_E_init_glorot_uniform</a>
, <a class="el" href="aifes__express__f32__fnn_8h.html#a35acc0093cf3f0ad28eb5c49b23d5e44a71b10c8f99beb2eadb896a33e5acb5eb">AIfES_E_init_no_init</a>
 }</td></tr>
<tr class="memdesc:a35acc0093cf3f0ad28eb5c49b23d5e44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Possible weight initialization methods in AIfES-Express.  <a href="aifes__express__f32__fnn_8h.html#a35acc0093cf3f0ad28eb5c49b23d5e44">More...</a><br /></td></tr>
<tr class="separator:a35acc0093cf3f0ad28eb5c49b23d5e44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4e0a3b4a420060fb232004d3bce5f878"><td class="memItemLeft" align="right" valign="top"><a id="a4e0a3b4a420060fb232004d3bce5f878"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aifes__express__f32__fnn_8h.html#a4e0a3b4a420060fb232004d3bce5f878">AIFES_E_early_stopping</a> { <b>AIfES_E_early_stopping_off</b>
, <b>AIfES_E_early_stopping_on</b>
 }</td></tr>
<tr class="memdesc:a4e0a3b4a420060fb232004d3bce5f878"><td class="mdescLeft">&#160;</td><td class="mdescRight">Turn early stopping on or off. <br /></td></tr>
<tr class="separator:a4e0a3b4a420060fb232004d3bce5f878"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a7cae69cea71af858ac246eb03f981ca0"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aifes__express__f32__fnn_8h.html#a7cae69cea71af858ac246eb03f981ca0">AIFES_E_flat_weights_number_fnn_f32</a> (uint32_t *fnn_structure, uint32_t layer_count)</td></tr>
<tr class="memdesc:a7cae69cea71af858ac246eb03f981ca0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculates the total required float weights for the selected network structure.  <a href="aifes__express__f32__fnn_8h.html#a7cae69cea71af858ac246eb03f981ca0">More...</a><br /></td></tr>
<tr class="separator:a7cae69cea71af858ac246eb03f981ca0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a51d3cc7a6d7da4fc0868cfd5bba340e8"><td class="memItemLeft" align="right" valign="top">int8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aifes__express__f32__fnn_8h.html#a51d3cc7a6d7da4fc0868cfd5bba340e8">AIFES_E_inference_fnn_f32</a> (<a class="el" href="structaitensor.html">aitensor_t</a> *input_tensor, <a class="el" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html">AIFES_E_model_parameter_fnn_f32</a> *AIFES_E_fnn, <a class="el" href="structaitensor.html">aitensor_t</a> *output_tensor)</td></tr>
<tr class="memdesc:a51d3cc7a6d7da4fc0868cfd5bba340e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Executes the inference.  <a href="aifes__express__f32__fnn_8h.html#a51d3cc7a6d7da4fc0868cfd5bba340e8">More...</a><br /></td></tr>
<tr class="separator:a51d3cc7a6d7da4fc0868cfd5bba340e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63eb5f444593f469a115f8c34b0a5be0"><td class="memItemLeft" align="right" valign="top">int8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="aifes__express__f32__fnn_8h.html#a63eb5f444593f469a115f8c34b0a5be0">AIFES_E_training_fnn_f32</a> (<a class="el" href="structaitensor.html">aitensor_t</a> *input_tensor, <a class="el" href="structaitensor.html">aitensor_t</a> *target_tensor, <a class="el" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html">AIFES_E_model_parameter_fnn_f32</a> *AIFES_E_fnn, <a class="el" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html">AIFES_E_training_parameter_fnn_f32</a> *AIFES_E_fnn_training, <a class="el" href="struct_a_i_f_e_s___e__init__weights__parameter__fnn__f32.html">AIFES_E_init_weights_parameter_fnn_f32</a> *AIFES_E_fnn_init_weights, <a class="el" href="structaitensor.html">aitensor_t</a> *output_tensor)</td></tr>
<tr class="memdesc:a63eb5f444593f469a115f8c34b0a5be0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Executes the training.  <a href="aifes__express__f32__fnn_8h.html#a63eb5f444593f469a115f8c34b0a5be0">More...</a><br /></td></tr>
<tr class="separator:a63eb5f444593f469a115f8c34b0a5be0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>AIfES Express functions for weights with F32 (float32) data type. </p>
<dl class="section version"><dt>Version</dt><dd>2.2.0 </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (C) 2020-2023 Fraunhofer Institute for Microelectronic Circuits and Systems. All rights reserved.<br  />
<br  />
 AIfES is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.<br  />
<br  />
 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.<br  />
<br  />
 You should have received a copy of the GNU Affero General Public License along with this program. If not, see <a href="https://www.gnu.org/licenses/">https://www.gnu.org/licenses/</a>.</dd></dl>
<p>AIfES Express is a beginner friendly high-level API of AIfES. This file contains all necessary functions for neural networks with float32 weights. </p>
</div><h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="a6dad88532ecc9bc7786bb69c0aab7c23"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6dad88532ecc9bc7786bb69c0aab7c23">&#9670;&nbsp;</a></span>AIFES_E_activations</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23">AIFES_E_activations</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Possible activation functions in AIfES-Express. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a6dad88532ecc9bc7786bb69c0aab7c23a90e8205e5c84ffb25fa38491b248b013"></a>AIfES_E_relu&#160;</td><td class="fielddoc"><p>Relu. </p>
</td></tr>
<tr><td class="fieldname"><a id="a6dad88532ecc9bc7786bb69c0aab7c23a68c5b8166b0ec1f39f3f66eae44907d6"></a>AIfES_E_sigmoid&#160;</td><td class="fielddoc"><p>Sigmoid. </p>
</td></tr>
<tr><td class="fieldname"><a id="a6dad88532ecc9bc7786bb69c0aab7c23a28fa45b9eb596a129f1be02bcebf9cf7"></a>AIfES_E_softmax&#160;</td><td class="fielddoc"><p>Softmax. </p>
</td></tr>
<tr><td class="fieldname"><a id="a6dad88532ecc9bc7786bb69c0aab7c23a34502c83d13d257df268941d828f33f8"></a>AIfES_E_leaky_relu&#160;</td><td class="fielddoc"><p>Leaky_relu. </p>
</td></tr>
<tr><td class="fieldname"><a id="a6dad88532ecc9bc7786bb69c0aab7c23ac682fe5e199bb2451b7bef2be8a55c4c"></a>AIfES_E_elu&#160;</td><td class="fielddoc"><p>Elu. </p>
</td></tr>
<tr><td class="fieldname"><a id="a6dad88532ecc9bc7786bb69c0aab7c23a7ca4f10620b8fca8ebf6e5d9a3ca4c98"></a>AIfES_E_tanh&#160;</td><td class="fielddoc"><p>Tanh. </p>
</td></tr>
<tr><td class="fieldname"><a id="a6dad88532ecc9bc7786bb69c0aab7c23ae2e92c9f3fdd4f778fffa154346c2213"></a>AIfES_E_softsign&#160;</td><td class="fielddoc"><p>Softsign. </p>
</td></tr>
<tr><td class="fieldname"><a id="a6dad88532ecc9bc7786bb69c0aab7c23af918200828e6049e46f83c0ca21db5b9"></a>AIfES_E_linear&#160;</td><td class="fielddoc"><p>Linear. </p>
</td></tr>
</table>

</div>
</div>
<a id="a35acc0093cf3f0ad28eb5c49b23d5e44"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a35acc0093cf3f0ad28eb5c49b23d5e44">&#9670;&nbsp;</a></span>AIFES_E_init_weights_method</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="aifes__express__f32__fnn_8h.html#a35acc0093cf3f0ad28eb5c49b23d5e44">AIFES_E_init_weights_method</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Possible weight initialization methods in AIfES-Express. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a35acc0093cf3f0ad28eb5c49b23d5e44aec06014a563924febf792beba6066e46"></a>AIfES_E_init_uniform&#160;</td><td class="fielddoc"><p>Dices the weights in a range of values you specify. </p>
</td></tr>
<tr><td class="fieldname"><a id="a35acc0093cf3f0ad28eb5c49b23d5e44af87a4fcba3d2e974db34883d63e763e6"></a>AIfES_E_init_glorot_uniform&#160;</td><td class="fielddoc"><p>Random numbers are uniformly diced within a certain range. </p>
</td></tr>
<tr><td class="fieldname"><a id="a35acc0093cf3f0ad28eb5c49b23d5e44a71b10c8f99beb2eadb896a33e5acb5eb"></a>AIfES_E_init_no_init&#160;</td><td class="fielddoc"><p>No weight init. </p>
<p>If starting weights are already available or if you want to continue training </p>
</td></tr>
</table>

</div>
</div>
<a id="a9d5599ca9f2382ad1150d53f6ba8cbea"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d5599ca9f2382ad1150d53f6ba8cbea">&#9670;&nbsp;</a></span>AIFES_E_loss</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="aifes__express__f32__fnn_8h.html#a9d5599ca9f2382ad1150d53f6ba8cbea">AIFES_E_loss</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Possible loss functions in AIfES-Express. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a9d5599ca9f2382ad1150d53f6ba8cbeaaf095a896485970ce1b22f3e43fafb45a"></a>AIfES_E_mse&#160;</td><td class="fielddoc"><p>Mean squared error (MSE) </p>
</td></tr>
<tr><td class="fieldname"><a id="a9d5599ca9f2382ad1150d53f6ba8cbeaac01d593ae21e3f8bbe8c0587b016dcdf"></a>AIfES_E_crossentropy&#160;</td><td class="fielddoc"><p>Crossentropy. </p>
</td></tr>
</table>

</div>
</div>
<a id="ac3fa2f42fb47ee5af7c7a3282d4f4cd0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac3fa2f42fb47ee5af7c7a3282d4f4cd0">&#9670;&nbsp;</a></span>AIFES_E_optimizer</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="aifes__express__f32__fnn_8h.html#ac3fa2f42fb47ee5af7c7a3282d4f4cd0">AIFES_E_optimizer</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Possible optimizers in AIfES-Express. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ac3fa2f42fb47ee5af7c7a3282d4f4cd0a4e1b034bc7b9050d2bf588d33cc31335"></a>AIfES_E_adam&#160;</td><td class="fielddoc"><p>ADAM. </p>
</td></tr>
<tr><td class="fieldname"><a id="ac3fa2f42fb47ee5af7c7a3282d4f4cd0a96fcd4b510ad51973f2fb6e380f98ad4"></a>AIfES_E_sgd&#160;</td><td class="fielddoc"><p>SGD. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a7cae69cea71af858ac246eb03f981ca0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7cae69cea71af858ac246eb03f981ca0">&#9670;&nbsp;</a></span>AIFES_E_flat_weights_number_fnn_f32()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t AIFES_E_flat_weights_number_fnn_f32 </td>
          <td>(</td>
          <td class="paramtype">uint32_t *&#160;</td>
          <td class="paramname"><em>fnn_structure</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>layer_count</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculates the total required float weights for the selected network structure. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*fnn_structure</td><td>The FNN structure </td></tr>
    <tr><td class="paramname">layer_count</td><td>Number of layers </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Number of float weights required </dd></dl>

</div>
</div>
<a id="a51d3cc7a6d7da4fc0868cfd5bba340e8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a51d3cc7a6d7da4fc0868cfd5bba340e8">&#9670;&nbsp;</a></span>AIFES_E_inference_fnn_f32()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int8_t AIFES_E_inference_fnn_f32 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>input_tensor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html">AIFES_E_model_parameter_fnn_f32</a> *&#160;</td>
          <td class="paramname"><em>AIFES_E_fnn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>output_tensor</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Executes the inference. </p>
<p>Requires the input tensor, the FNN model parameters and an output tensor for the results. All data sets of the input tensor are calculated</p>
<p>Possible returns:</p><ul>
<li>0 = success</li>
<li>1 = ERROR! Tensor dtype</li>
<li>2 = ERROR! Tensor shape: Data Number</li>
<li>3 = ERROR! Input tensor shape does not correspond to ANN inputs</li>
<li>4 = ERROR! Output tensor shape does not correspond to ANN outputs</li>
<li>5 = ERROR! Unknown activation function</li>
<li>6 = ERROR! Not enough memory</li>
</ul>
<p><b>Example:</b> </p><div class="fragment"><div class="line">uint32_t nn_structure[3] = {2,3,1};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23">AIFES_E_activations</a> nn_activations[2];</div>
<div class="line">nn_activations[0] = <a class="code" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23a68c5b8166b0ec1f39f3f66eae44907d6">AIfES_E_sigmoid</a>;</div>
<div class="line">nn_activations[1] = <a class="code" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23a68c5b8166b0ec1f39f3f66eae44907d6">AIfES_E_sigmoid</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">float</span> weights[] = {-10.1164f, -8.4212f, 5.4396f, 7.297f, -7.6482f, -9.0155f, -2.9653f,</div>
<div class="line">                    2.3677f, -1.5968f, 12.0305f, -6.5858f, 11.9371f,-5.4247f};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html">AIFES_E_model_parameter_fnn_f32</a> nn;</div>
<div class="line">nn.<a class="code" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html#a7c6673fb07eaacde14fefa8739cf81d9">layer_count</a> = 3;</div>
<div class="line">nn.<a class="code" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html#ac0e27d2721e3fc56a5271daa70a1c4cf">fnn_structure</a> = nn_structure;</div>
<div class="line">nn.<a class="code" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html#ac19fe5a39b6c6c68774d040417741b5c">fnn_activations</a> = nn_activations;</div>
<div class="line">nn.<a class="code" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html#a4c8ac1a2e6acb80433ed33dafe5e703d">flat_weights</a> = weights;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">float</span> input_data[4][2] = {</div>
<div class="line">    {0.0f, 0.0f},</div>
<div class="line">    {0.0f, 1.0f},</div>
<div class="line">    {1.0f, 0.0f},</div>
<div class="line">    {1.0f, 1.0f}</div>
<div class="line">};</div>
<div class="line">uint16_t input_shape[4*2] = {4, 2};                     <span class="comment">// Definition of the input shape</span></div>
<div class="line"><a class="code" href="structaitensor.html">aitensor_t</a> input_tensor = AITENSOR_2D_F32(input_shape, input_data);                 <span class="comment">// Macro for the simple creation of a float32 tensor. Also usable in the normal AIfES version</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">float</span> output_data[4*1];                                                        <span class="comment">// Output data</span></div>
<div class="line">uint16_t output_shape[] = {4, 1};</div>
<div class="line"><a class="code" href="structaitensor.html">aitensor_t</a> output_tensor = AITENSOR_2D_F32(output_shape, output_data);</div>
<div class="line"> </div>
<div class="line">int8_t error;</div>
<div class="line">error = <a class="code" href="aifes__express__f32__fnn_8h.html#a51d3cc7a6d7da4fc0868cfd5bba340e8">AIFES_E_inference_fnn_f32</a>(&amp;input_tensor,</div>
<div class="line">                                  &amp;nn,</div>
<div class="line">                                  &amp;output_tensor);</div>
<div class="ttc" id="aaifes__express__f32__fnn_8h_html_a51d3cc7a6d7da4fc0868cfd5bba340e8"><div class="ttname"><a href="aifes__express__f32__fnn_8h.html#a51d3cc7a6d7da4fc0868cfd5bba340e8">AIFES_E_inference_fnn_f32</a></div><div class="ttdeci">int8_t AIFES_E_inference_fnn_f32(aitensor_t *input_tensor, AIFES_E_model_parameter_fnn_f32 *AIFES_E_fnn, aitensor_t *output_tensor)</div><div class="ttdoc">Executes the inference.</div></div>
<div class="ttc" id="aaifes__express__f32__fnn_8h_html_a6dad88532ecc9bc7786bb69c0aab7c23"><div class="ttname"><a href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23">AIFES_E_activations</a></div><div class="ttdeci">AIFES_E_activations</div><div class="ttdoc">Possible activation functions in AIfES-Express.</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:34</div></div>
<div class="ttc" id="aaifes__express__f32__fnn_8h_html_a6dad88532ecc9bc7786bb69c0aab7c23a68c5b8166b0ec1f39f3f66eae44907d6"><div class="ttname"><a href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23a68c5b8166b0ec1f39f3f66eae44907d6">AIfES_E_sigmoid</a></div><div class="ttdeci">@ AIfES_E_sigmoid</div><div class="ttdoc">Sigmoid.</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:36</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__model__parameter__fnn__f32_html"><div class="ttname"><a href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html">AIFES_E_model_parameter_fnn_f32</a></div><div class="ttdoc">Parameters for the FNN model.</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:107</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__model__parameter__fnn__f32_html_a4c8ac1a2e6acb80433ed33dafe5e703d"><div class="ttname"><a href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html#a4c8ac1a2e6acb80433ed33dafe5e703d">AIFES_E_model_parameter_fnn_f32::flat_weights</a></div><div class="ttdeci">void * flat_weights</div><div class="ttdoc">Pointer to the array with the weights.</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:111</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__model__parameter__fnn__f32_html_a7c6673fb07eaacde14fefa8739cf81d9"><div class="ttname"><a href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html#a7c6673fb07eaacde14fefa8739cf81d9">AIFES_E_model_parameter_fnn_f32::layer_count</a></div><div class="ttdeci">uint32_t layer_count</div><div class="ttdoc">Count of all layers, including input and output layers.</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:108</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__model__parameter__fnn__f32_html_ac0e27d2721e3fc56a5271daa70a1c4cf"><div class="ttname"><a href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html#ac0e27d2721e3fc56a5271daa70a1c4cf">AIFES_E_model_parameter_fnn_f32::fnn_structure</a></div><div class="ttdeci">uint32_t * fnn_structure</div><div class="ttdoc">Pointer to the network structure.</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:109</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__model__parameter__fnn__f32_html_ac19fe5a39b6c6c68774d040417741b5c"><div class="ttname"><a href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html#ac19fe5a39b6c6c68774d040417741b5c">AIFES_E_model_parameter_fnn_f32::fnn_activations</a></div><div class="ttdeci">AIFES_E_activations * fnn_activations</div><div class="ttdoc">Pointer to the activation function list (AIFES_E_activations)</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:110</div></div>
<div class="ttc" id="astructaitensor_html"><div class="ttname"><a href="structaitensor.html">aitensor</a></div><div class="ttdoc">A tensor in AIfES.</div><div class="ttdef"><b>Definition:</b> aifes_math.h:89</div></div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*input_tensor</td><td>Tensor with the inputs </td></tr>
    <tr><td class="paramname">*AIFES_E_fnn</td><td>The FNN model parameters </td></tr>
    <tr><td class="paramname">*output_tensor</td><td>Tensor for the results </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Error output </dd></dl>

</div>
</div>
<a id="a63eb5f444593f469a115f8c34b0a5be0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a63eb5f444593f469a115f8c34b0a5be0">&#9670;&nbsp;</a></span>AIFES_E_training_fnn_f32()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int8_t AIFES_E_training_fnn_f32 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>input_tensor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>target_tensor</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html">AIFES_E_model_parameter_fnn_f32</a> *&#160;</td>
          <td class="paramname"><em>AIFES_E_fnn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html">AIFES_E_training_parameter_fnn_f32</a> *&#160;</td>
          <td class="paramname"><em>AIFES_E_fnn_training</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_a_i_f_e_s___e__init__weights__parameter__fnn__f32.html">AIFES_E_init_weights_parameter_fnn_f32</a> *&#160;</td>
          <td class="paramname"><em>AIFES_E_fnn_init_weights</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structaitensor.html">aitensor_t</a> *&#160;</td>
          <td class="paramname"><em>output_tensor</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Executes the training. </p>
<p>Requires the input tensor, the target tensor, FNN model parameters, training parameters, weight initialization method and an output tensor for the results. All data sets of the input tensor are used for the training</p>
<p>Possible returns:</p><ul>
<li>0 = success</li>
<li>1 = ERROR! Tensor dtype</li>
<li>2 = ERROR! Tensor shape: Data Number</li>
<li>3 = ERROR! Input tensor shape does not correspond to ANN inputs</li>
<li>4 = ERROR! Output tensor shape does not correspond to ANN outputs</li>
<li>5 = ERROR! Use the crossentropy as loss for softmax</li>
<li>6 = ERROR! learn_rate or sgd_momentum negative</li>
<li>7 = ERROR! Init uniform weights min - max wrong</li>
<li>8 = ERROR! batch_size: min = 1 / max = Number of training data</li>
<li>9 = ERROR! Unknown activation function</li>
<li>10 = ERROR! Unknown loss function</li>
<li>11 = ERROR! Unknown init weights method</li>
<li>12 = ERROR! Unknown optimizer</li>
<li>13 = ERROR! Not enough memory</li>
</ul>
<p><b>Example:</b> </p><div class="fragment"><div class="line"><span class="keywordtype">void</span> my_print_function(<span class="keywordtype">float</span> loss)</div>
<div class="line">{</div>
<div class="line">   <span class="comment">//E.g. a normal print output</span></div>
<div class="line">   printf(<span class="stringliteral">&quot;Loss: %f\n&quot;</span>, loss);</div>
<div class="line">}</div>
<div class="line">uint32_t nn_structure[3] = {2,3,1};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23">AIFES_E_activations</a> nn_activations[2];</div>
<div class="line">nn_activations[0] = <a class="code" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23a68c5b8166b0ec1f39f3f66eae44907d6">AIfES_E_sigmoid</a>;</div>
<div class="line">nn_activations[1] = <a class="code" href="aifes__express__f32__fnn_8h.html#a6dad88532ecc9bc7786bb69c0aab7c23a68c5b8166b0ec1f39f3f66eae44907d6">AIfES_E_sigmoid</a>;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">float</span> weights[] = {-10.1164f, -8.4212f, 5.4396f, 7.297f, -7.6482f, -9.0155f, -2.9653f,</div>
<div class="line">                    2.3677f, -1.5968f, 12.0305f, -6.5858f, 11.9371f,-5.4247f};</div>
<div class="line"> </div>
<div class="line"><a class="code" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html">AIFES_E_model_parameter_fnn_f32</a> nn;</div>
<div class="line">nn.<a class="code" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html#a7c6673fb07eaacde14fefa8739cf81d9">layer_count</a> = 3;</div>
<div class="line">nn.<a class="code" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html#ac0e27d2721e3fc56a5271daa70a1c4cf">fnn_structure</a> = nn_structure;</div>
<div class="line">nn.<a class="code" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html#ac19fe5a39b6c6c68774d040417741b5c">fnn_activations</a> = nn_activations;</div>
<div class="line">nn.<a class="code" href="struct_a_i_f_e_s___e__model__parameter__fnn__f32.html#a4c8ac1a2e6acb80433ed33dafe5e703d">flat_weights</a> = weights;</div>
<div class="line"> </div>
<div class="line"><a class="code" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html">AIFES_E_training_parameter_fnn_f32</a>  nn_train_config;</div>
<div class="line">nn_train_config.<a class="code" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#a9f597ad8d0c7bedb69b05275c9c5acc3">optimizer</a> = <a class="code" href="aifes__express__f32__fnn_8h.html#ac3fa2f42fb47ee5af7c7a3282d4f4cd0a4e1b034bc7b9050d2bf588d33cc31335">AIfES_E_adam</a>;</div>
<div class="line">nn_train_config.<a class="code" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#a349b9731a66bc2f669c93112b5fc50ff">sgd_momentum</a> = 0.0f;         <span class="comment">// Only for SGD optimizer</span></div>
<div class="line">nn_train_config.<a class="code" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#afc50e0264bae1a9eed729878ec54d6e4">loss</a> = <a class="code" href="aifes__express__f32__fnn_8h.html#a9d5599ca9f2382ad1150d53f6ba8cbeaaf095a896485970ce1b22f3e43fafb45a">AIfES_E_mse</a>;</div>
<div class="line">nn_train_config.<a class="code" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#a057f27f74563c8ba830131c483b39902">learn_rate</a> = 0.05f;</div>
<div class="line">nn_train_config.<a class="code" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#a42b47542862c6c711ffbae806f59f730">batch_size</a> = 4;</div>
<div class="line">nn_train_config.<a class="code" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#afcd5a1f03534b477aed17a33deb227ff">epochs</a> = 100;</div>
<div class="line">nn_train_config.<a class="code" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#ad7ad39d347c8d89d3744dbc2e765bfdf">epochs_loss_print_interval</a> = 10;</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Your individual print function</span></div>
<div class="line">nn_train_config.<a class="code" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#a395b877f575f44fcef603db0362368fc">loss_print_function</a> = my_print_function;</div>
<div class="line"> </div>
<div class="line"><span class="comment">//You can enable early stopping, so that learning is automatically stopped when a learning target is reached</span></div>
<div class="line">nn_train_config.<a class="code" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#a08c80aea59827f5457bc262a85494a57">early_stopping</a> = AIfES_E_early_stopping_on;</div>
<div class="line"><span class="comment">//Define your target loss</span></div>
<div class="line">nn_train_config.<a class="code" href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#a7e0b5a1386fd3f0214d5f7910def14ef">early_stopping_target_loss</a> = 0.004;</div>
<div class="line"> </div>
<div class="line"><a class="code" href="struct_a_i_f_e_s___e__init__weights__parameter__fnn__f32.html">AIFES_E_init_weights_parameter_fnn_f32</a>  nn_weights_init;</div>
<div class="line">nn_weights_init.<a class="code" href="struct_a_i_f_e_s___e__init__weights__parameter__fnn__f32.html#a53ff47a067c37773857386dea83f220b">init_weights_method</a> = <a class="code" href="aifes__express__f32__fnn_8h.html#a35acc0093cf3f0ad28eb5c49b23d5e44af87a4fcba3d2e974db34883d63e763e6">AIfES_E_init_glorot_uniform</a> ;</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">float</span> input_data[4][2] = {</div>
<div class="line">    {0.0f, 0.0f},</div>
<div class="line">    {0.0f, 1.0f},</div>
<div class="line">    {1.0f, 0.0f},</div>
<div class="line">    {1.0f, 1.0f}</div>
<div class="line">};</div>
<div class="line">uint16_t input_shape[4*2] = {4, 2};                     <span class="comment">// Definition of the input shape</span></div>
<div class="line"><a class="code" href="structaitensor.html">aitensor_t</a> input_tensor = AITENSOR_2D_F32(input_shape, input_data);                 <span class="comment">// Macro for the simple creation of a float32 tensor. Also usable in the normal AIfES version</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">float</span> target_data[4*1] = {0.0f, 1.0f, 1.0f, 0.0f};                                     <span class="comment">// Target Data</span></div>
<div class="line">uint16_t target_shape[] = {4, 1};</div>
<div class="line"><a class="code" href="structaitensor.html">aitensor_t</a> target_tensor = AITENSOR_2D_F32(target_shape, target_data);              <span class="comment">// Macro for the simple creation of a float32 tensor. Also usable in the normal AIfES version</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">float</span> output_data[4*1];                                                        <span class="comment">// Output data</span></div>
<div class="line">uint16_t output_shape[] = {4, 1};</div>
<div class="line"><a class="code" href="structaitensor.html">aitensor_t</a> output_tensor = AITENSOR_2D_F32(output_shape, output_data);</div>
<div class="line"> </div>
<div class="line">int8_t error;</div>
<div class="line">error = <a class="code" href="aifes__express__f32__fnn_8h.html#a63eb5f444593f469a115f8c34b0a5be0">AIFES_E_training_fnn_f32</a>(&amp;input_tensor,</div>
<div class="line">                                 &amp;target_tensor,</div>
<div class="line">                                 &amp;nn,</div>
<div class="line">                                 &amp;nn_train_config,</div>
<div class="line">                                 &amp;nn_weights_init,</div>
<div class="line">                                 &amp;output_tensor);</div>
<div class="ttc" id="aaifes__express__f32__fnn_8h_html_a35acc0093cf3f0ad28eb5c49b23d5e44af87a4fcba3d2e974db34883d63e763e6"><div class="ttname"><a href="aifes__express__f32__fnn_8h.html#a35acc0093cf3f0ad28eb5c49b23d5e44af87a4fcba3d2e974db34883d63e763e6">AIfES_E_init_glorot_uniform</a></div><div class="ttdeci">@ AIfES_E_init_glorot_uniform</div><div class="ttdoc">Random numbers are uniformly diced within a certain range.</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:69</div></div>
<div class="ttc" id="aaifes__express__f32__fnn_8h_html_a63eb5f444593f469a115f8c34b0a5be0"><div class="ttname"><a href="aifes__express__f32__fnn_8h.html#a63eb5f444593f469a115f8c34b0a5be0">AIFES_E_training_fnn_f32</a></div><div class="ttdeci">int8_t AIFES_E_training_fnn_f32(aitensor_t *input_tensor, aitensor_t *target_tensor, AIFES_E_model_parameter_fnn_f32 *AIFES_E_fnn, AIFES_E_training_parameter_fnn_f32 *AIFES_E_fnn_training, AIFES_E_init_weights_parameter_fnn_f32 *AIFES_E_fnn_init_weights, aitensor_t *output_tensor)</div><div class="ttdoc">Executes the training.</div></div>
<div class="ttc" id="aaifes__express__f32__fnn_8h_html_a9d5599ca9f2382ad1150d53f6ba8cbeaaf095a896485970ce1b22f3e43fafb45a"><div class="ttname"><a href="aifes__express__f32__fnn_8h.html#a9d5599ca9f2382ad1150d53f6ba8cbeaaf095a896485970ce1b22f3e43fafb45a">AIfES_E_mse</a></div><div class="ttdeci">@ AIfES_E_mse</div><div class="ttdoc">Mean squared error (MSE)</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:50</div></div>
<div class="ttc" id="aaifes__express__f32__fnn_8h_html_ac3fa2f42fb47ee5af7c7a3282d4f4cd0a4e1b034bc7b9050d2bf588d33cc31335"><div class="ttname"><a href="aifes__express__f32__fnn_8h.html#ac3fa2f42fb47ee5af7c7a3282d4f4cd0a4e1b034bc7b9050d2bf588d33cc31335">AIfES_E_adam</a></div><div class="ttdeci">@ AIfES_E_adam</div><div class="ttdoc">ADAM.</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:59</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__init__weights__parameter__fnn__f32_html"><div class="ttname"><a href="struct_a_i_f_e_s___e__init__weights__parameter__fnn__f32.html">AIFES_E_init_weights_parameter_fnn_f32</a></div><div class="ttdoc">Parameters for weight initialization.</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:184</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__init__weights__parameter__fnn__f32_html_a53ff47a067c37773857386dea83f220b"><div class="ttname"><a href="struct_a_i_f_e_s___e__init__weights__parameter__fnn__f32.html#a53ff47a067c37773857386dea83f220b">AIFES_E_init_weights_parameter_fnn_f32::init_weights_method</a></div><div class="ttdeci">AIFES_E_init_weights_method init_weights_method</div><div class="ttdoc">Weight initialization method (AIFES_E_init_weights_method)</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:185</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__training__parameter__fnn__f32_html"><div class="ttname"><a href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html">AIFES_E_training_parameter_fnn_f32</a></div><div class="ttdoc">Parameters for Training.</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:138</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__training__parameter__fnn__f32_html_a057f27f74563c8ba830131c483b39902"><div class="ttname"><a href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#a057f27f74563c8ba830131c483b39902">AIFES_E_training_parameter_fnn_f32::learn_rate</a></div><div class="ttdeci">float learn_rate</div><div class="ttdoc">Learning rate for training (For all optimizers)</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:141</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__training__parameter__fnn__f32_html_a08c80aea59827f5457bc262a85494a57"><div class="ttname"><a href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#a08c80aea59827f5457bc262a85494a57">AIFES_E_training_parameter_fnn_f32::early_stopping</a></div><div class="ttdeci">AIFES_E_early_stopping early_stopping</div><div class="ttdoc">Switch early stopping on or off.</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:162</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__training__parameter__fnn__f32_html_a349b9731a66bc2f669c93112b5fc50ff"><div class="ttname"><a href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#a349b9731a66bc2f669c93112b5fc50ff">AIFES_E_training_parameter_fnn_f32::sgd_momentum</a></div><div class="ttdeci">float sgd_momentum</div><div class="ttdoc">Optional momentum for SGD (Value 0.0f means Momentum off)</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:142</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__training__parameter__fnn__f32_html_a395b877f575f44fcef603db0362368fc"><div class="ttname"><a href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#a395b877f575f44fcef603db0362368fc">AIFES_E_training_parameter_fnn_f32::loss_print_function</a></div><div class="ttdeci">void(* loss_print_function)(float)</div><div class="ttdoc">Individual print function for the loss.</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:161</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__training__parameter__fnn__f32_html_a42b47542862c6c711ffbae806f59f730"><div class="ttname"><a href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#a42b47542862c6c711ffbae806f59f730">AIFES_E_training_parameter_fnn_f32::batch_size</a></div><div class="ttdeci">uint32_t batch_size</div><div class="ttdoc">Batch size (min: 1 -&gt; max: Entire data set)</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:143</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__training__parameter__fnn__f32_html_a7e0b5a1386fd3f0214d5f7910def14ef"><div class="ttname"><a href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#a7e0b5a1386fd3f0214d5f7910def14ef">AIFES_E_training_parameter_fnn_f32::early_stopping_target_loss</a></div><div class="ttdeci">float early_stopping_target_loss</div><div class="ttdoc">If early stopping is switched on, the target loss can be specified here.</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:163</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__training__parameter__fnn__f32_html_a9f597ad8d0c7bedb69b05275c9c5acc3"><div class="ttname"><a href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#a9f597ad8d0c7bedb69b05275c9c5acc3">AIFES_E_training_parameter_fnn_f32::optimizer</a></div><div class="ttdeci">AIFES_E_optimizer optimizer</div><div class="ttdoc">Optimizer selection (AIFES_E_optimizer)</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:140</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__training__parameter__fnn__f32_html_ad7ad39d347c8d89d3744dbc2e765bfdf"><div class="ttname"><a href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#ad7ad39d347c8d89d3744dbc2e765bfdf">AIFES_E_training_parameter_fnn_f32::epochs_loss_print_interval</a></div><div class="ttdeci">uint32_t epochs_loss_print_interval</div><div class="ttdoc">Selection of the interval in which the loss is to be calculated and output via the print function.</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:145</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__training__parameter__fnn__f32_html_afc50e0264bae1a9eed729878ec54d6e4"><div class="ttname"><a href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#afc50e0264bae1a9eed729878ec54d6e4">AIFES_E_training_parameter_fnn_f32::loss</a></div><div class="ttdeci">AIFES_E_loss loss</div><div class="ttdoc">Loss selection (AIFES_E_loss)</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:139</div></div>
<div class="ttc" id="astruct_a_i_f_e_s___e__training__parameter__fnn__f32_html_afcd5a1f03534b477aed17a33deb227ff"><div class="ttname"><a href="struct_a_i_f_e_s___e__training__parameter__fnn__f32.html#afcd5a1f03534b477aed17a33deb227ff">AIFES_E_training_parameter_fnn_f32::epochs</a></div><div class="ttdeci">uint32_t epochs</div><div class="ttdoc">Number of desired epochs (If early stopping is on, can be stopped before)</div><div class="ttdef"><b>Definition:</b> aifes_express_f32_fnn.h:144</div></div>
</div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*input_tensor</td><td>Tensor with the input training data </td></tr>
    <tr><td class="paramname">*target_tensor</td><td>Tensor with the training target data / labels </td></tr>
    <tr><td class="paramname">*AIFES_E_fnn</td><td>The FNN model parameters </td></tr>
    <tr><td class="paramname">*AIFES_E_fnn_training</td><td>The training parameters </td></tr>
    <tr><td class="paramname">*AIFES_E_fnn_init_weights</td><td>The weight init parameters </td></tr>
    <tr><td class="paramname">*output_tensor</td><td>Tensor for the results </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Error output </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_1e5d3661ed79af157d57e64a38265d09.html">basic</a></li><li class="navelem"><a class="el" href="dir_d248cdab09ece91db2a68dd96cc4ef4f.html">express</a></li><li class="navelem"><a class="el" href="aifes__express__f32__fnn_8h.html">aifes_express_f32_fnn.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
